#pragma once

#include "connection_base.h"

#include "dispatcher.h"

namespace anb { namespace net {

class connection : public connection_base
{
public:
	connection(loop::ptr loop, uv_tcp_t* tcp, dispatcher::ptr dispatcher);
	virtual ~connection();

	typedef boost::shared_ptr<connection> ptr;

	void send_packet();

protected:
	virtual void handle_head(const uv_buf_t& segment);
	virtual void handle_body(const uv_buf_t& segment);

private:
	dispatcher::ptr m_dispatcher;
};

} }